CFn DeletionPolicyの記載場所に気をつけて
よくある間違い
code: NG.yml
SampleBucket:
Type: 'AWS::S3::Bucket'
Properties:
AccessControl: Private
BucketName: "sample-bucket"
DeletionPolicy: Retain # propertiesの下に書いちゃう。これダメ。
正解
code: OK.yml
SampleBucket:
Type: 'AWS::S3::Bucket'
DeletionPolicy: Retain # Propertiesと同じ階層に書く。
Properties:
AccessControl: Private
BucketName: "sample-bucket"
参考